#pragma once

#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <cctype>

namespace PokerBoxUtils
{

    class String
    {
    public:
        static std::vector<std::string> Split(const std::string &s, char delimiter)
        {
            std::vector<std::string> tokens;
            std::istringstream tokenStream(s);
            std::string token;
            while (std::getline(tokenStream, token, delimiter))
            {
                tokens.push_back(token);
            }
            return tokens;
        }

        static std::string Trim(const std::string &str)
        {
            size_t startpos = str.find_first_not_of(" \t\n\r\f\v");
            if (std::string::npos == startpos)
                return ""; // no content

            size_t endpos = str.find_last_not_of(" \t\n\r\f\v");
            return str.substr(startpos, endpos - startpos + 1);
        }
    };
}